<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table cellSpacing="1" cellPadding="0" width="100%" align="center" bgColor="#f5fafe" border="0">
    <tr>
        <td align="center" bgColor="#afd1f3"><strong>订单详细信息</strong></td>
    </tr>
    <tr>
        <td>
            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td height="22" align="center" bgColor="#f5fafe">订单编号：</td>
                    <td bgColor="#ffffff">${view.getId()}
                    </td>
                    <td height="22" align="center" bgColor="#f5fafe">所属用户：</td>
                    <td  bgColor="#ffffff"><p>${view.getUser().getUsername()}</p>
                    </td>
                </tr>
                <tr>
                    <td height="22" align="center" bgColor="#f5fafe">收件人：</td>
                    <td bgColor="#ffffff"><p>${view.getReceiverName()}</p>
                    </td>
                    <td height="22" align="center" bgColor="#f5fafe">联系电话：</td>
                    <td  bgColor="#ffffff"><p>${view.getReceiverPhone()}</p>
                    </td>
                </tr>
                <tr>
                    <td height="22" align="center" bgColor="#f5fafe">送货地址：</td>
                    <td bgColor="#ffffff"><p>${view.getReceiverAddress()}</p>
                    </td>
                    <td height="22" align="center" bgColor="#f5fafe">总价：</td>
                    <td  bgColor="#ffffff"><p>${view.getMoney()}</p>
                    </td>
                </tr>
                <tr>
                    <td height="22" align="center" bgColor="#f5fafe">下单时间：</td>
                    <td bgColor="#ffffff" colspan="3"><p>${view.getOrderTime()}</p>
                    </td>
                </tr>
                <tr>
                    <td height="22" align="center" bgColor="#f5fafe">商品信息：</td>
                    <td bgColor="#ffffff" colspan="3">
                        <table cellspacing="0" cellpadding="1" rules="all"
                               bordercolor="gray" border="1" id="DataGrid1"
                               style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
                            <tr
                                    style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">
                                <td align="center" width="6%">序号</td>
                                <td align="center" width="18%">商品编号</td>
                                <td align="center" width="10%">商品名称</td>
                                <td align="center" width="10%">商品价格</td>
                                <td width="8%" align="center">购买数量</td>
                                <td width="8%" align="center">商品类型</td>
                                <td width="36%" align="center">商品描述</td>
                            </tr>
                            <c:forEach items="${view.getOrderItems()}" var="orderItem" varStatus="index">
                            <tr onmouseover="this.style.backgroundColor = 'white'"
                                onmouseout="this.style.backgroundColor = '#F5FAFE';">
                                <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                                        ${index.count}
                                </td>
                                <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                                        ${orderItem.getProduct().getId()}
                                </td>
                                <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                                        ${orderItem.getProduct().getName()}
                                </td>
                                <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                                        ${orderItem.getProduct().getPrice()}
                                </td>
                                <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                                        ${orderItem.getBuyNum()}
                                </td>
                                <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                                        ${orderItem.getProduct().getCategory()}
                                </td>
                                <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                                        ${orderItem.getProduct().getDescription()}
                                </td>
                            </tr>
                            </c:forEach>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td width="100" height="22" align="center" bgColor="#f5fafe"></td>
                    <td bgColor="#ffffff"><font face="宋体"
                                                color="red"> &nbsp;</font></td>
                    <td align="right" bgColor="#ffffff"><br /> <br /></td>
                    <td align="right" bgColor="#ffffff">
                        <a href="${pageContext.request.contextPath}/FindOrdersServlet">
                            <button type="button" id="back" name="back" value="返回">返回</button>
                        </a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</body>
</html>
